package top.csy8888.likework.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import top.csy8888.likework.common.vo.ResultVO;
import top.csy8888.likework.dto.PostDTO;
import top.csy8888.likework.entity.Post;
import top.csy8888.likework.service.PostService;

import java.util.List;

/**
 * @author CSY
 * @date 2025 - 10 - 13
 */
@RestController
@RequestMapping("/api")
@RequiredArgsConstructor
public class PostController {
    private final PostService postService;

    @GetMapping("/post/{postId}")
    public ResultVO<List<PostDTO>> listPost(@PathVariable("postId") Integer postId){
        List<PostDTO> postDTOS = postService.listPost(postId);
        return ResultVO.success(postDTOS);
    }
}
